package com.example.demo.pattern.observerpattern.display;


import com.example.demo.pattern.observerpattern.station.WeatherStation;

public class DisplayBoard1 implements Observer, Display {
    private String temperature;
    private String humidity;
    private WeatherStation weatherStation;

    public DisplayBoard1(WeatherStation weatherStation) {
        this.weatherStation = weatherStation;
    }

    @Override
    public void display() {
        System.out.println(temperature + humidity);
    }

    @Override
    public void update(String temperature, String humidity, String pressure) {
        this.temperature = temperature;
        this.humidity = humidity;
        display();
    }
}
